package com.example.attack.utils;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;

public interface IBaseEnum {

    String getCode();

    String getDesc();

    default boolean equalsCode(String code) {
        if (StringUtils.isBlank(code)) {
            return false;
        }
        return this.getCode().equals(code);
    }

    default boolean equalsCode(IBaseEnum enums) {
        if (ObjectUtils.isNull(enums)) {
            return false;
        }
        return this.getCode().equals(enums.getCode()) && this.getDesc().equals(enums.getDesc());
    }
}
